package com.guo.boot.study.thread;

/**
 * @Auther Heart Guo
 * @Date 2021/12/23-10:22
 */
//静态代理
public class Proxy {
    public static void main(String[] args) {
        new Wedding(new NewPeople()).HappyMarry();
    }
}

interface Marry1{
    void HappyMarry();
}

class NewPeople implements Marry1{

    @Override
    public void HappyMarry() {
        System.out.println("接亲");
        System.out.println("进行婚礼");
        System.out.println("开心");
    }
}

class Wedding implements Marry1{
    private Marry1 target;

    public Wedding(Marry1 target) {
        this.target = target;
    }

    @Override
    public void HappyMarry() {
        befor();
        this.target.HappyMarry();
        after();
    }

    private void after() {
        System.out.println("收拾现场，收尾款");
    }

    private void befor() {
        System.out.println("定制方案，布置现场");
    }
}
